package com.yunhe.policyfulfillment.policyful.repository;

import com.yunhe.policyfulfillment.policyful.domain.PolicyInfoNews;
import com.yunhe.policyfulfillment.policyful.model.PolicyInfoNewsQueryCondition;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PolicyInfoNewsRepository {
    /**
     * 新增
     * @author hetao
     * @date 2021/07/23
     **/
    int createPolicyInfoNews(PolicyInfoNews policyInfoNews);

    /**
     * 新增
     * @author hetao
     * @date 2021/07/23
     **/
    int createPolicyInfoNewsSelective(PolicyInfoNews policyInfoNews);

    /**
     * 刪除
     * @author hetao
     * @date 2021/07/23
     **/
    int deletePolicyInfoNewsByPrimaryKey(@Param("id") long id);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/23
     **/
    int updatePolicyInfoNewsByPrimaryKey(PolicyInfoNews policyInfoNews);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/23
     **/
    int updatePolicyInfoNewsByPrimaryKeySelective(PolicyInfoNews policyInfoNews);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/07/23
     **/
    PolicyInfoNews searchPolicyInfoNewsByPrimaryKey(@Param("id") long id);

    List<PolicyInfoNews> findPolicyInfoNewsByQueryCondition(PolicyInfoNewsQueryCondition policyInfoNewsQueryCondition);

    int getCountByIsHot();

    int getCountByIsNew();

    /**
     * 查询5条热门新闻
     * @return
     */
    List<PolicyInfoNews> findHotNew();

    /**
     * 查询通知公告
     * @param title
     * @return
     */
    List<PolicyInfoNews> findNewByTitle(@Param("title") String title);

    void publishTimedNew();

    List<PolicyInfoNews> findPortalPolicyInfoNewsByQueryCondition(PolicyInfoNewsQueryCondition policyInfoNewsQueryCondition);

}